<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://com.yhm.pagination/pager" prefix="p"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>分页测试</title>
<link href="${pageContext.request.contextPath}/css/page.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/sea.js"></script>
<script type="text/javascript">
	//JS导入
	seajs.config({
		base: '${pageContext.request.contextPath}/js/',
		alias: {
			'jquery'  : 'jquery.debug'
		},
		preload: ['jquery'],
		debug: false,
		charset: 'utf-8'
	});
	function callback(){
		console.log("提交之前执行的回调函数");
		return true;//必须返回true才会自动提交表单，否则需要用户自己处理提交
	}
	var x1;           if(!x1){ console.log("x1="+x1); }
	var x2="";        if(!x2){ console.log("x2="+x2); }
	var x3=undefined; if(!x3){ console.log("x3="+x3); }
	var x4=null;      if(!x4){ console.log("x4="+x4); }
	var x5=0;         if(!x5){ console.log("x5="+x5); }
	var x6=false;     if(!x6){ console.log("x6="+x6); }
	var x7=NaN;       if(!x7){ console.log("x7="+x7); }
	var x8='';        if(!x8){ console.log("x8="+x8); }
	
	if(!x1&&!x2&&!x3&&!x4&&!x5&&!x6&&!x7&&!x8){
		console.log("结果为false");
	}
</script>
</head>
<body>
<pre>
	<b>所有参数以form设置的method="post"方式提交</b>
	传递post参数：user.name,user.code,user.sex,user.description,pageUtil.currentPage,pageUtil.pageSize
</pre>
	<form action="${pageContext.request.contextPath}/findAll11" method="post" id="frmquery1" callback="callback">
		<div>名字：<input type="text" name="user.name" value="${user.name}"><br/>
		             账号：<input type="text" name="user.code" value="${user.code}"><br/>
		             性别: <select name="user.sex">
		              <option value="0" ${user.sex==0?"selected='selected'":""}>女</option>
		              <option value="1" ${user.sex==1?"selected='selected'":""}>男</option>
		           </select><br/> 
		            说明:<textarea rows="3" cols="16" name="user.description" id="descriptor">${user.description}</textarea><br/>
		           		           	                     
		<input type="submit" value="查询"></div>
		
		<table>
			<tr selectTr="xxxxxx"><th>名字</th><th>年龄</th></tr>			
			<c:forEach items="${users}" var="u">
				<tr>
					<td>${u.name}</td>
					<td>${u.sexName}</td>
				</tr>
			</c:forEach>
		</table>
		<div class="badoo" style="text-align: left">
		   <p:pager name="pageUtil" currentPage="${pageUtil.currentPage}" pageSize="${pageUtil.pageSize}" totalCount="${pageUtil.totalCount}"  pagerForm="frmquery1" seaJS="1"/>
		</div>
	</form>
	<script type="text/javascript">
		seajs.use(["jquery","searchtip"], function(jquery,searchtip){
			var $ = jquery;			
			var b = searchtip;
			var d1=new Date();
			
			$("#descriptor").keypress(function(e){
				alert(b.getSelectTr($("tr")));
				//alert("keypress");	
			});
			$("#descriptor").keydown(function(e){
				//alert("keydown");	
			});
			$("#descriptor").keyup(function(e){
				//alert("keyup");	
			});
		});
	</script>
</body>
</html>